var entityCollection = require('../../../Base/server/controllers/EntityCollection');

//质检类型
exports.QCType = {
    FullReview: 0,  //全检
    Inspection: 1,  //巡检
    FirstQuality: 2     //首件质检
};

//质检指标类型
exports.QCNormType = {
    FullReview: 0,      //数值    
    Inspection: 1,      //字符
    FirstQuality: 2,    //布尔
    Select: 3           //选择
};

//质检状态
exports.QCStatus = {
    Qualified: 0,       //合格
    NotQualified: 1,    //不合格
    Concession: 2,      //让步接收
    Decide: 3,          //品质判定
    Rework: 4,          //返工
    Scrap: 5,           //报废
    Special: 6          //特裁
};

//查找所有的不同的枚举信息
exports.findAllExtendEnum = function (code,completeFun) {
    
    var entity = entityCollection.getEntity("ExtendEnum");

    entity.findOne({Code: code}, null,
      function(err, record) {
        if (err) {
            var newErr = new Error();
            newErr.leval = 9;
            newErr.title = '查询枚举信息错误';
            newErr.message = '请检查查询参数！';
            completeFun(newErr);
        } else {
            completeFun(null, record);
        }
    });
};
